home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_russianborder.cog < prev    next >
Text File  |  1999-11-15  |  10KB  |  377 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Riv_RussianBorder.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #========================================================================================
  9.  
  10. symbols
  11.    
  12.     message        startup      
  13.     message        entered
  14.     
  15.     # ** boarder cutscene triggers **
  16.     sector        lower
  17.     surface        upper
  18.     
  19.     # ** water ambient triggers **
  20.     sector      stop_Water1     linkID=0
  21.     sector      stop_Water2     linkID=0
  22.     sector      start_Water1    linkID=1
  23.     
  24.     
  25.     # ** misc local things **
  26.     thing        player      local
  27.     thing       indy        local
  28.     thing       indyTarget  local
  29.     
  30.     # ** lower cutscene things **
  31.     thing        lower_Cam1
  32.     thing        lower_Cam3
  33.     thing       lower_CamTarg1
  34.     thing       lower_Targ1
  35.     thing       lower_LookTarg
  36.     
  37.     # ** upper cutscene things
  38.     thing        upper_Cam1
  39.     thing       upper_Cam2
  40.     thing        upper_CamTarg1
  41.     thing       upper_Targ1
  42.     thing       upper_LookTarg
  43.     thing       upper_CamPos
  44.     
  45.     # ** truck stuff **
  46.     thing       truck
  47.     thing       t_Ghost0    # move truck to this pos
  48.     
  49.     # ** ambient pos **
  50.     thing       ambientPos
  51.     
  52.     template    tpl_Actor=indy_actor                    local
  53.     template    tpl_Ghost=ghost                         local
  54.     
  55.     keyframe    inStand1=0in_stand4.key                 local
  56.     keyframe    inThinking=0in_thinking_4_4.key         local
  57.     keyframe    inStand2=0in_stand1_bd_4.key            local
  58.     
  59.     sound        sayline=Rv01j01.wav                        local    # Uh oh, the Soviet border...
  60.     sound       mus_CheckPoint=mus_gen_russbold1.wav    local
  61.     sound       snd_Engine=jep_reverse_loop.wav         local
  62.     sound       snd_Water=shs_h2odrain_c.wav            local   # ambient water sound
  63.     
  64.     material    mat_Wheel=obj_a_truck_tire.mat          local
  65.     
  66.     cog         towerWpnt
  67.     cog         borderGate
  68.     
  69.     # ** subroutines **
  70.     flex        lowerCut        local
  71.     flex        upperCut        local
  72.     
  73.     flex        min=15
  74.     flex        max=35
  75.     flex        vol=0.5
  76.     
  77.     int            done=0          local
  78.     int         inTrack         local
  79.     int         music_Track     local
  80.     int         truck_Track     local
  81.     int         voice_Track     local
  82.     int         chnl_Water      local
  83.     int         playing=0       local
  84.     
  85. end
  86.  
  87. #========================================================================================
  88.  
  89. code
  90.  
  91. startup:
  92.     
  93.     player = GetLocalPlayerThing();
  94.     
  95.     return;
  96.     
  97. #========================================================================================
  98.  
  99. entered:
  100.  
  101.  
  102.     if((GetSenderRef() == lower) && (done == 0))
  103.     {
  104.         done = 1;
  105.         Call lowerCut;
  106.     }
  107.         
  108.     if((GetSenderRef() == upper) && (done == 0))
  109.     {
  110.         done = 1;
  111.         call upperCut;
  112.     }
  113.     
  114.     if(GetSenderID() == 0)
  115.     {
  116.         playing = 0;
  117.         StopSound(chnl_Water, 0.5);
  118.     }
  119.     
  120.     if((GetSenderID() == 1) && (playing == 0))
  121.     {
  122.         playing = 1;
  123.         chnl_Water = PlaySoundThing(snd_Water, ambientPos, 1.0, min, max, 0x045);
  124.     }
  125.         
  126.     return;
  127.     
  128. #========================================================================================
  129.     
  130. lowerCut:
  131.         
  132.     chnl_Water = PlaySoundThing(snd_Water, ambientPos, 0.5, min, max, 0x045);  # 1/2 vol
  133.     
  134.     # fire up waypoint cog
  135.     SendMessage(towerWpnt, user0);
  136.     
  137.     # do cutscene stuff
  138.     MakeMeStop();
  139.     StartCutscene(2);
  140.     
  141.     # put away any weapons
  142.     DeselectWeaponWait(player);
  143.     
  144.     # create indy actor
  145.     indy = CreateThing(tpl_Actor, player);
  146.     CaptureThing(indy);
  147.     
  148.     # outfit indy actor
  149.     CopyPlayerHolsters(player, indy);
  150.     
  151.     # hide player show indy
  152.     SetThingFlags(player, 0x80000);
  153.     ClearThingFlags(indy, 0x80000);
  154.     
  155.     # play music cue
  156.     music_Track = PlaySoundLocal(mus_CheckPoint, 1.0, 0.0, 0x0, 0);
  157.     
  158.     # indy walks to lower_Targ1
  159.     AISetCutsceneMode(indy);
  160.     AISetMoveSpeed(indy, 1.0);
  161.     AISetLookThing(indy, lower_Targ1);
  162.     AISetMoveThing(indy, lower_Targ1, 0);
  163.     
  164.     # prepare the truck
  165.     SetCollideType(truck, 0);
  166.     ClearThingFlags(truck, 0x80000);    # show
  167.     SetPhysicsFlags(truck, 0x10);       # align to surface
  168.     truck_Track = PlaySoundThing(snd_Engine, truck, 1.0, 5, 20, 0x85);
  169.     MaterialAnim(mat_Wheel, 16, 1);
  170.     
  171.     Sleep(1.5);
  172.     
  173.     # move truck past camera
  174.     AISetMoveSpeed(truck, 2.0);
  175.     AISetLookThing(truck, t_Ghost0);
  176.     AISetMoveThing(truck, t_Ghost0, 0);
  177.     
  178.     Sleep(0.1);
  179.     
  180.     #cut to lower_Cam1
  181.     SetCameraSecondaryFocus(2, lower_CamTarg1);
  182.     SetCameraFocus(2, lower_Cam1);
  183.     SetCurrentCamera(2);
  184.     
  185.     Sleep(0.01);
  186.     
  187.     # indy looks towards tower
  188.     AISetLookThing(indy, lower_LookTarg);
  189.     
  190.     # move lower_Cam1 to lower_Cam3
  191.     MoveThingToPos(lower_Cam1, GetThingPos(lower_Cam3), 12.0);
  192.     
  193.     Sleep(10.0);
  194.     
  195.     # move target to indy's position
  196.     MoveToFrame(lower_CamTarg1, 1, 2.0);
  197.     
  198.     # get rid of the truck
  199.     StopSound(truck_Track, 0.5);
  200.     DestroyThing(truck);
  201.     
  202.     Sleep(2.0);
  203.     
  204.     # create target at indy's position
  205.     indyTarget = CreateThingAtPos(tpl_Ghost, GetThingSector(indy), GetThingPos(indy), '0 0 0');
  206.     CaptureThing(indyTarget);
  207.     
  208.     Sleep(0.01);
  209.     
  210.     AttachThingToThing(lower_Cam1, indyTarget);
  211.     Sleep(0.01);
  212.     
  213.     Rotate(indyTarget, -110.0, 1, 2.0); #90
  214.     
  215.     # indy adjusts his hat as he looks over the border
  216.     inTrack = PlayKey(indy, inStand1, 2, 0x0, 0);
  217.     PlayKey(indy, inStand2, 4, 0x12, 1);
  218.     voice_Track = PlayVoice(player, sayline, 1.0, 0);
  219.     PlayKey(indy, inThinking, 4, 0x12, 0);
  220.     StopKey(indy, inTrack, 0.5);
  221.     
  222.     # close the boarder gate
  223.     SendMessage(borderGate, user0);
  224.     
  225.     WaitForSound(voice_Track);
  226.     
  227.     Sleep(0.5);
  228.     
  229.     # Get the player into position
  230.     CopyOrientAndPos(indy, player);
  231.     
  232.     # hide actor show player
  233.     SetThingFlags(indy, 0x80000);
  234.     ClearThingFlags(player, 0x80000);
  235.     
  236.     # restore camera to player
  237.     SetCameraPosition(1, GetThingPos(lower_Cam1));
  238.     SetCurrentCamera(1);
  239.         
  240.     # restore controls
  241.     ClearActorFlags(player, 0x200000);
  242.     EndCutscene();
  243.     
  244.     # turn on commie instincts
  245.     SendMessage(towerWpnt, user1);
  246.     
  247.     # turn up ambient water to full vol
  248.     ChangeSoundVol(chnl_Water, 1.0, 0.75);
  249.     
  250.     return;
  251.             
  252. #========================================================================================
  253.  
  254. upperCut:
  255.  
  256.     chnl_Water = PlaySoundThing(snd_Water, ambientPos, 0.5, min, max, 0x045);  # 1/2 vol
  257.     
  258.     # fire up waypoint cog
  259.     SendMessage(towerWpnt, user0);
  260.     
  261.     # do cutscene stuff
  262.     MakeMeStop();
  263.     StartCutscene(2);
  264.     
  265.     # put away any weapons
  266.     DeselectWeaponWait(player);
  267.     
  268.     # create indy actor
  269.     indy = CreateThing(tpl_Actor, player);
  270.     CaptureThing(indy);
  271.     
  272.     # outfit indy actor
  273.     CopyPlayerHolsters(player, indy);
  274.     
  275.     # hide player show indy
  276.     SetThingFlags(player, 0x80000);
  277.     ClearThingFlags(indy, 0x80000);
  278.     
  279.     # play music cue
  280.     music_Track = PlaySoundLocal(mus_CheckPoint, 1.0, 0.0, 0x0, 0);
  281.     
  282.     # indy moves over to ai target
  283.     AISetCutsceneMode(indy);
  284.     AISetMoveSpeed(indy, 1.0);
  285.     AISetLookThing(indy, upper_Targ1);
  286.     AISetMoveThing(indy, upper_Targ1, 0);
  287.     
  288.     # prepare the truck
  289.     SetCollideType(truck, 0);
  290.     ClearThingFlags(truck, 0x80000);    # show
  291.     SetPhysicsFlags(truck, 0x10);       # align to surface
  292.     truck_Track = PlaySoundThing(snd_Engine, truck, 1.0, 5, 20, 0x85);
  293.     MaterialAnim(mat_Wheel, 16, 1);
  294.     
  295.     Sleep(1.5);
  296.     
  297.     # move truck past camera
  298.     AISetMoveSpeed(truck, 2.0);
  299.     AISetLookThing(truck, t_Ghost0);
  300.     AISetMoveThing(truck, t_Ghost0, 0);
  301.     
  302.     Sleep(0.1);
  303.     
  304.     # cut to upper_Cam1
  305.     #SetCameraSecondaryFocus(2, upper_CamTarg1);
  306.     SetCameraSecondaryFocus(2, indy);
  307.     SetCameraFocus(2, upper_Cam1);
  308.     SetCurrentCamera(2);
  309.     
  310.     Sleep(0.01);
  311.     
  312.     # move lower_Cam1 to upper_Cam2
  313.     MoveThingToPos(upper_Cam1, GetThingPos(upper_Cam2), 12.0);
  314.     
  315.     # have indy look at tower
  316.     AISetLookThing(indy, upper_LookTarg);
  317.     
  318.     # close the boarder gate
  319.     SendMessage(borderGate, user0);
  320.     
  321.     Sleep(10.0);
  322.     
  323.     # move target to indy's position
  324.     MoveToFrame(upper_CamTarg1, 1, 4.0);
  325.     
  326.     # get rid of the truck
  327.     StopSound(truck_Track, 0.5);
  328.     DestroyThing(truck);
  329.     
  330.     Sleep(2.0); # 1.9
  331.     
  332.     # create target at indy's position
  333.     indyTarget = CreateThingAtPos(tpl_Ghost, GetThingSector(indy), GetThingPos(indy), '0 0 0');
  334.     CaptureThing(indyTarget);
  335.     
  336.     AttachThingToThing(upper_Cam1, indyTarget);
  337.     
  338.     Rotate(indyTarget, -110.0, 1, 2.0); #90
  339.     
  340.     # indy adjusts his hat as he looks over the border
  341.     inTrack = PlayKey(indy, inStand1, 2, 0x0, 0);
  342.     PlayKey(indy, inStand2, 4, 0x12, 1);
  343.     voice_Track = PlayVoice(player, sayline, 1.0, 0);
  344.     PlayKey(indy, inThinking, 4, 0x12, 0);
  345.     StopKey(indy, inTrack, 0.5);
  346.     
  347.     WaitForSound(voice_Track);
  348.     
  349.     Sleep(0.5);
  350.                             
  351.     # Get the player into position
  352.     CopyOrientAndPos(indy, player);
  353.     
  354.     # hide actor show player
  355.     SetThingFlags(indy, 0x80000);
  356.     ClearThingFlags(player, 0x80000);
  357.     
  358.     # restore camera to player
  359.     SetCameraPosition(1, GetThingPos(upper_CamPos));
  360.     SetCurrentCamera(1);
  361.         
  362.     # restore controls
  363.     ClearActorFlags(player, 0x200000);
  364.     EndCutscene();
  365.     
  366.     # turn on commie instincts
  367.     SendMessage(towerWpnt, user1);
  368.     
  369.     # turn up ambient water to full vol
  370.     ChangeSoundVol(chnl_Water, 1.0, 0.75);
  371.     
  372.     return;
  373.  
  374. #========================================================================================
  375.  
  376. end
  377.